<?php $rating = $CtDocumento->getValoracion('frontend'); ?>
<script type="text/javascript">
  $(document).ready(function(){
    $.fn.rating.options = { required: true };
    input = $('input[type=radio].star');
    input.rating();
<?php if ($rating): ?> 
      input.rating('select','<?php echo $rating['valor']; ?>'); 
<?php endif; ?>
    input.rating('readOnly',true);
    $('#stars').css('display', 'block');

  });
</script>
<div id="stars">
  <?php if ($rating): ?>
    <span id="star-average" class="text_well">
      <span class="text_well_big"><?php echo $rating['promedio']; ?></span> / 5<br>
      Votantes: <?php echo $rating['votantes']; ?>
    </span><br /><br />
  <?php endif; ?>
  <form id="stars-form" name="rating-form">
    <input type="radio" class="star" value="1"/>
    <input type="radio" class="star" value="2"/>
    <input type="radio" class="star" value="3"/>
    <input type="radio" class="star" value="4"/>
    <input type="radio" class="star" value="5"/>
  </form>
</div>
